export const reportTypeOption = [
  {
    label: '状态',
    value: '1'
  },
  {
    label: '计数',
    value: '2'
  },
  {
    label: '报警',
    value: '3'
  },
  {
    label: '实时数据',
    value: '4'
  }
]

export const reportNameOption = [
  {
    label: 'A',
    value: 'A'
  },
  {
    label: 'H',
    value: 'H'
  },
  {
    label: 'L',
    value: 'L'
  },
  {
    label: 'DevPower',
    value: 'DevPower'
  }
]

export const dataTypeOption = [
  {
    label: 'bool',
    value: '0'
  },
  {
    label: 'byte',
    value: '1'
  },
  {
    label: 'char',
    value: '2'
  },
  {
    label: 'ushort',
    value: '3'
  },
  {
    label: 'short',
    value: '4'
  },
  {
    label: 'uint',
    value: '5'
  },
  {
    label: 'int',
    value: '6'
  },
  {
    label: 'float',
    value: '7'
  },
  {
    label: 'double',
    value: '8'
  },
  {
    label: 'string',
    value: '9'
  },
  {
    label: 'long',
    value: '10'
  },
  {
    label: 'ulong',
    value: '11'
  }
]

export const dataTypeReportOption = [
  {
    label: '整数',
    value: 1
  },
  {
    label: '字符串',
    value: 2
  },
  {
    label: '小数',
    value: 3
  }
]

export const wanOptionsObj = {}
export const wanOptions = [
  {
    label: 'mobile',
    value: 'mobile'
  },
  {
    label: 'LAN1',
    value: 'lan_0'
  },
  {
    label: 'LAN2',
    value: 'lan_1'
  }
]

wanOptions.forEach(item => {
  wanOptionsObj[item.value] = item.label
})

export const modeOptionsObj = {}
export const modeOptions = [
  {
    label: '默认',
    value: 'SYS'
  },
  {
    label: '自定义',
    value: 'USER'
  }
]
modeOptions.forEach(item => {
  modeOptionsObj[item.value] = item.label
})

export const deploymentStatusObj = {}
export const deploymentStatusList = [
  {
    label: '全部',
    value: null
  },
  {
    label: '未部署',
    value: 'undeploy'
  },
  {
    label: '部署中',
    value: 'processing'
  },
  {
    label: '已部署',
    value: 'success'
  },
  {
    label: '部署失败',
    value: 'failed'
  },
  {
    label: '部署失败(超时)',
    value: 'timeout'
  }
]

export const gatewayStatusList = [
  {
    label: '全部',
    value: null
  },
  {
    label: '在线',
    value: 'ONLINE'
  },
  {
    label: '离线',
    value: 'OFFLINE'
  }
]

deploymentStatusList.forEach(item => {
  deploymentStatusObj[item.value] = item.label
})

export const commonPointList = Object.keys(Array.apply(null, { length: 500 })).map((item) => `Point_${item}`)
export const commonAlarmlList = Object.keys(Array.apply(null, { length: 500 })).map((item) => `Alarml_${item}`)
export const commonAlarmhList = Object.keys(Array.apply(null, { length: 500 })).map((item) => `Alarmh_${item}`)

export const connectObj = {
  '0': '未连接',
  '1': '已连接',
  '2': '故障'
}

export const networkStateObj = {
  '-1': '未发现模组',
  '0': '正常',
  '1': 'SIM卡识别失败',
  '2': '网络被拒绝'
}

export const ioInfoObj = {
  '0': '未触发',
  '1': '触发'
}

export const deviceTypeOptions = [
  {
    label: '设备',
    value: '1'
  },
  {
    label: '仪表',
    value: '2'
  }
]

export const connectStatus = [{ label: '全部', value: null }, { label: '未激活', value: 'inactivated' }, { label: '在线', value: 'online' }, { label: '离线', value: 'offline' }]
export const connectStatusObj = {}
connectStatus.forEach(item => {
  connectStatusObj[item.value] = item.label
})

export const partcountType = [
  {
    label: '清零(当本次计数小于上一次, 做清零处理)',
    value: '1'
  },
  {
    label: '累加(当本次计数大于上一次, 做累加处理)',
    value: '2'
  }
]

export const partcountObj = {
  '1': '清零',
  '2': '累加'
}

export const digitOptions = [
  {
    label: '1',
    value: '1'
  },
  {
    label: '2',
    value: '2'
  },
  {
    label: '3',
    value: '3'
  },
  {
    label: '4',
    value: '4'
  },
  {
    label: '5',
    value: '5'
  }
]
